<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Debug extends CI_Controller {
	
	/** 
	 *	Academic survey Page
	 *	Debug页面
	 *
	 */
 	public function __construct() {
		parent::__construct();
		$this->load->helper('form');
		$this->load->library('form_validation');
		$this->load->model('debug_model');
	}
	
	public function index() {
		// $this->form_validation->set_rules('variety_name[]', '品种名称', 'required');
		// $this->form_validation->set_rules('variety_area[]', '品种种植面积', 'required');
		// $this->form_validation->set_rules('variety_usage_select[]', '用途选项', 'required');
		// $this->form_validation->set_rules('variety_usage[]', '品种用途', 'required');
		// $this->form_validation->set_rules('force', '强行验证', 'required');

		if($this->form_validation->run() == FALSE) {
			$this->load->view('debug/debug');
			$this->load->view('templates/footer');
			// $this->load->view('templates/debug');
			$this->output->enable_profiler(TRUE);
		}
		else {
			$this->debug_model->set_varieties();
			$this->load->view('debug/debug_success');
			$this->output->enable_profiler(TRUE);
		}
	}
}